<template>
    <div class="title-three" :style="`border-color: ${base.color}`" @click="linkTo">
        <span class="title-text">{{content.value}}</span>
    </div>
</template>

<script>
    export default {
        name: 'TitleThree',
        props: {
            content: {
                type: Object,
                default: _ => {
                    return {
                        value: '标题文字',
                        link: ''
                    };
                }
            },
            base: {
                type: Object,
                default: _ => {
                    return {
                        titleType: '',
                        color: 'rgba(248,89,89,1)'
                    };
                }
            }
        },
        methods: {
            linkTo() {
                let link = this.content.link;
                link && window.open(link);
            }
        }
    }
</script>

<style scoped lang="scss">
    .title-three {
        height: 100%;
        font-size: 20px;
        line-height: 30px;
        font-weight: 600;
        text-indent: 1rem;
        cursor: pointer;
        border-left: 3px solid transparent;
        background-color: rgba(#cccccc, .3);

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
</style>
